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

Query time 0.00029