UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bPLVepdaRlzAawNnlGmBFdGRJyaouBQxCiqWf57TqSU='
WHERE
key_id = '5903255f805c75b6f20cc5d5c293c5d48b7b7ea87edc5b873407cd026786b891'
AND (
token = 'bPLVepdaRlzAawNnlGmBFdGRJyaouBQxCiqWf57TqSU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)