UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IimLp91DSTJKjdNF9DTPXacoVb8yKMeFw3KqG+46hYY='
WHERE
key_id = 'aebb5b0c5d54f9ea7549e598c005fb0ae9869af4622c0e11ae2cdcbe9fa8f014'
AND (
token = 'IimLp91DSTJKjdNF9DTPXacoVb8yKMeFw3KqG+46hYY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)