UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G7BD5INTCriNkmiXdE0SeIV9t3d+K4YLckGOXobdVfg=' 
WHERE 
  key_id = 'e257c593b22bbcd233e423bae07ac2f5326dc10b5b38579ca0660a994239a8c1' 
  AND (
    token = 'G7BD5INTCriNkmiXdE0SeIV9t3d+K4YLckGOXobdVfg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030