UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kF64q6RUr5C5EA+YKkcCY4/4aaSu9QZuq5xpS09t8SA=' 
WHERE 
  key_id = '12a41a9bb868593a1507c09072848720fcaed36a2503c31b62e4c2821500bfd3' 
  AND (
    token = 'kF64q6RUr5C5EA+YKkcCY4/4aaSu9QZuq5xpS09t8SA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013