UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RHtCREJLT8XbMOaBd+Zt6+GoEfJTwVy1Jur0LyQgW6M='
WHERE
key_id = '1298ec53ce4303bba2105d14d03e54750a5b250f659d3b1fd9e7c4cb7889e0fd'
AND (
token = 'RHtCREJLT8XbMOaBd+Zt6+GoEfJTwVy1Jur0LyQgW6M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)