UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P0o2A40jVOwf8r0AyYBFY+0py0IIZowsD0sKo8jr1zg=' 
WHERE 
  key_id = '9e21df4ea349c3bc8a517264de0e356443787e0fa9b4bb37b12add8a48435440' 
  AND (
    token = 'P0o2A40jVOwf8r0AyYBFY+0py0IIZowsD0sKo8jr1zg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045