UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8LMxKazLxnoGVaNTjLG4YcFFrzbEWx9lPVbtGxR69zE=' 
WHERE 
  key_id = '01fd457bb9d4eac9fc30449f2b63a32b655f31eb6ae65b84e17d3ada2abcf2b2' 
  AND (
    token = '8LMxKazLxnoGVaNTjLG4YcFFrzbEWx9lPVbtGxR69zE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049