UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VE7PmtnvICAnCuHcZLqh9TWPFWOqYIaHtWdV7KS9rDY='
WHERE
key_id = '11d73ca9b76f70b20f561fde3dd74daf840e10fe48c7458894ee44f693bb948d'
AND (
token = 'VE7PmtnvICAnCuHcZLqh9TWPFWOqYIaHtWdV7KS9rDY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)