UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HoxjBR+SZA6YQk1rLFgdXAcketbQ/3JvIdKivyQ/i6s='
WHERE
key_id = '7a684b529f37746eb5d72445a8b61090170594c114a312c6f8a8fca14c0134c2'
AND (
token = 'HoxjBR+SZA6YQk1rLFgdXAcketbQ/3JvIdKivyQ/i6s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)