UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't2Ufry/9+jgJtsq4CaTy68oM6aMERf3i96SYPOgcz9c=' 
WHERE 
  key_id = '5007b778fa4b39db4ed73b6dc1a82e7505b7f0312b520ced72857abd553891e6' 
  AND (
    token = 't2Ufry/9+jgJtsq4CaTy68oM6aMERf3i96SYPOgcz9c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026