UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '50sD99/Jq7Bx0s91wPz+UjgKSmmET5IfnlNWQRhtJh0='
WHERE
key_id = '5c5205c4262648f65b9d81c477882d7e926ae348a7b9fd99f3ec59de0da2cc87'
AND (
token = '50sD99/Jq7Bx0s91wPz+UjgKSmmET5IfnlNWQRhtJh0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)