UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JzeFCJACnoD6XiduvgFXn5vFh+dvRCyE85DoQ5mHkds='
WHERE
key_id = 'faa4b6533e47bf22d812ed7f620295a8d41099885ce5ab8185b508b29a3ffa65'
AND (
token = 'JzeFCJACnoD6XiduvgFXn5vFh+dvRCyE85DoQ5mHkds='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)