UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K+HEne/xs/hElbXvZie/AVGsTrOoyXOsoQj5Cu2UUzM='
WHERE
key_id = 'fee50954fa649b65c67b1b47d74bebfc4270afe0fae204910bf920796607fd84'
AND (
token = 'K+HEne/xs/hElbXvZie/AVGsTrOoyXOsoQj5Cu2UUzM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)