UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XIEMaxK3VonEYwF8T3t4IEvmPEgvYbniX/ElAfBR96A=' 
WHERE 
  key_id = '070b8b25fd34e72ab72dc85665f5f5a5d58783d4883201a2a9015dd5ce9bd8dd' 
  AND (
    token = 'XIEMaxK3VonEYwF8T3t4IEvmPEgvYbniX/ElAfBR96A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00116