UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+Rzub5R93ZBM7TYZC2F3lL0JjqRvjdye3Egfommn7B4='
WHERE
key_id = 'c5c535572bac3dda69da62109d844b725cac6a6aefd27fadf0e13c6c16624555'
AND (
token = '+Rzub5R93ZBM7TYZC2F3lL0JjqRvjdye3Egfommn7B4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)