UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BdUkX864ICLjnZ1d/doZNImIfFpatdlicitFWR/3ZEs='
WHERE
key_id = '9c1eb1d0e1ea5e80973571b0bf257b8cbd3aa1a5ebb1768b9cc57517496d45a7'
AND (
token = 'BdUkX864ICLjnZ1d/doZNImIfFpatdlicitFWR/3ZEs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)