UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IIuJujVF9N36Ygfz6uOrto/RtdAizen7CV9Xqv7aYD8=' 
WHERE 
  key_id = '35b64e36484d5a1e3721ad4c466b71e96b43dd10b982297f3f889dba472a4745' 
  AND (
    token = 'IIuJujVF9N36Ygfz6uOrto/RtdAizen7CV9Xqv7aYD8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016