UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4ocKiBgy0TM57SDWyNCt0G/yn5T7y+w5A9DMtpF00ts=' 
WHERE 
  key_id = '17acf3c64163fe376563fa46f7fa1124b34f9f1884bb2493703b3496946df0b7' 
  AND (
    token = '4ocKiBgy0TM57SDWyNCt0G/yn5T7y+w5A9DMtpF00ts=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027