UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lcmw5KM6DHiJY7qiKwGZTFVEDJrCHmy3Yw4dzkSgSZ8=' 
WHERE 
  key_id = 'db803a654bb82fd407ba9010b3a7bd34c1dbcc7c3fecf64ffd24cb2c94cc5e0b' 
  AND (
    token = 'lcmw5KM6DHiJY7qiKwGZTFVEDJrCHmy3Yw4dzkSgSZ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00085