UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9kZIFtXUG5BbGJGptjq/4V9X/KGU3qj05sNpnLA6BDY=' 
WHERE 
  key_id = '7c78534923aad5dbebb4da468502d4f39dedba23bd678b84ff4814e07d62eb43' 
  AND (
    token = '9kZIFtXUG5BbGJGptjq/4V9X/KGU3qj05sNpnLA6BDY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028