UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+08jNpthmiXoQgNekUqvR7td8ivVs6WjhvVYTFoZDYE='
WHERE
key_id = '57ee3601fcae1b09fc116ea0c480d885617b2cb1c5ae0585ca8d94b6ba4bfdbc'
AND (
token = '+08jNpthmiXoQgNekUqvR7td8ivVs6WjhvVYTFoZDYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)