UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SZO5gZ3UeOP1KlqVxlErb0J7QYE/5ham3TJecKfWTPg=' 
WHERE 
  key_id = '63734c028577488f87e62687c7ff02664ae68a585831b5a155b365cdf50ef4e0' 
  AND (
    token = 'SZO5gZ3UeOP1KlqVxlErb0J7QYE/5ham3TJecKfWTPg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042