UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZBwA24R4x7EhytuFf2nd9/Ii8VUPyjp9y9mIFZU0BkA='
WHERE
key_id = 'f8284008b6813996323e9511b2066f152f198e0b419c6315bf8d20e6f527acde'
AND (
token = 'ZBwA24R4x7EhytuFf2nd9/Ii8VUPyjp9y9mIFZU0BkA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)