UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mrDAEBGMMb/QpHGOwsbd3q92h0IkfYjktYY6xWWeGGU='
WHERE
key_id = '2cd91c3db4268d53883a8b4086569cb97275f13386a22573e6e54a024b6cce28'
AND (
token = 'mrDAEBGMMb/QpHGOwsbd3q92h0IkfYjktYY6xWWeGGU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)