UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eOib4lLqAzEEp9PaBqc75FiTDBh4kiOpq1fczE99FRg=' 
WHERE 
  key_id = 'bd5671f2de26fb30234849c626375eac812bbd8c68f38c3fc9af9ffac819e8d8' 
  AND (
    token = 'eOib4lLqAzEEp9PaBqc75FiTDBh4kiOpq1fczE99FRg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019