UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cfNnVKhEuyrJp6bL0Tz2w3x2iF6Z4bAO5DUI7Qe1ilg=' 
WHERE 
  key_id = '15c2b3256abf6425bf26861e485132332f92a0d52df891d5f5c00573d4011343' 
  AND (
    token = 'cfNnVKhEuyrJp6bL0Tz2w3x2iF6Z4bAO5DUI7Qe1ilg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00099