UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ULRJfy0O4hsjT1L1NqHOrQgZYPAK5VSolzb6wlvYdXA='
WHERE
key_id = '1c0cb6d94a15c3b675edad863777f8ad09c58daa4be4f1635f28476033e34b17'
AND (
token = 'ULRJfy0O4hsjT1L1NqHOrQgZYPAK5VSolzb6wlvYdXA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)